serializeEntry

open fun serializeEntry(input: T?, flags: Byte): ValidationResult<TomlElement>

Serializes either the provided input or stored value to a TomlElement

If the input is not null, it should be serialized, otherwise the stored value of this serializer (or a fallback value) should be serialized. Serialization of the correct type should occur either way.

Return

validation result wrapping a TomlElement with the serialized result.

Author

fzzyhmstrs

Since

0.7.0

Parameters

input

T, nullable. The optional external value to serialize

errorBuilder

ValidationResult.ErrorEntry.Mutable for appending error messages. Serialization should fail soft, returning a fallback TomlElement or TomlNull as a last resort instead of crashing. Problems should be appended to the builder.

flags

serialization flags for passing to built in serialization methods as needed.


abstract fun serializeEntry(input: T?, errorBuilder: MutableList<String>, flags: Byte): TomlElement

Deprecated

Implement the override using ValidationResult.ErrorEntry.Mutable. Scheduled for removal in 0.8.0.

Serializes either the provided input or stored value to a TomlElement

If the input is not null, it should be serialized, otherwise the stored value of this serializer (or a fallback value) should be serialized. Serialization of the correct type should occur either way.

Return

TomlElement with the serialized result.

Author

fzzyhmstrs

Since

0.1.1, deprecated 0.7.0 and scheduled for removal 0.8.0

Parameters

input

T, nullable. The optional external value to serialize

errorBuilder

List for appending error messages. Serialization should fail soft, returning a fallback TomlElement or TomlNull as a last resort instead of crashing. Problems should be appended to the builder.

flags

serialization flags for passing to built in serialization methods as needed.